package com.qq.mybatisdemo.controller;

import com.github.pagehelper.PageInfo;
import com.qq.mybatisdemo.bean.User;
import com.qq.mybatisdemo.configration.DataSourceContextHolder;
import com.qq.mybatisdemo.configration.DataSourceKey;
import com.qq.mybatisdemo.configration.TargetDataSource;
import com.qq.mybatisdemo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class UserController {
    @Autowired
    private UserService userService;

    @RequestMapping("/all")
    //@TargetDataSource(dataSourceKey=DataSourceKey.prodKey)
    public Object getAllUser(){
        PageInfo<User> user = userService.getPagenationUser();
        return user;
    }
}
